package entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author 橙子
 * @since 2023-02-27
 */
@Getter
@Setter
@TableName("tb_user")
@ApiModel(value = "User对象", description = "")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId;

    @ApiModelProperty("用户账号")
    @TableField("user_name")
    private String userName;

    @ApiModelProperty("用户邮箱")
    @TableField("user_email")
    private String userEmail;

    @ApiModelProperty("用户手机")
    @TableField("user_phone")
    private String userPhone;


    @ApiModelProperty("注册时间")
    @TableField("reg_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime regTime;


    @ApiModelProperty("消费金额")
    @TableField("user_buy_money")
    private BigDecimal buyMoney;


    @ApiModelProperty("状态 （0：冻结   1：正常）")
    @TableField("status")
    private Integer status;

    @ApiModelProperty("用户生日 （0000-00-00）格式")
    @TableField("user_birthday")
    private String userBirthday;

    @ApiModelProperty("用户地址（取省市两级地址）")
    @TableField("user_address")
    private String userAddress;

    @ApiModelProperty("用户性别")
    @TableField("user_gender")
    private String userGender;


}
